package tech.ezrealc.fall2023.service.affair.major;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.ezrealc.fall2023.model.affair.major.MajorDTO;
import tech.ezrealc.fall2023.model.affair.major.mapper.MajorMapper;
import tech.ezrealc.fall2023.repository.affair.major.MajorRepository;

import java.util.List;

@Service
@Transactional
public class MajorService {

    @Resource
    private MajorRepository majorRepository;

    @Resource
    private MajorMapper majorMapper;

    public List<MajorDTO> queryAll() {
        return majorMapper.toDTOList(majorRepository.selectAll());
    }

}
